﻿<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <Header>
    <Title>DevExpress MVC ComboBox</Title>
    <Author>Žeks</Author>
    <Shortcut>dxcmb</Shortcut>
    <Description></Description>
    <SnippetTypes>
      <SnippetType>Expansion</SnippetType>
    </SnippetTypes>
  </Header>
  <Snippet>
    <Declarations>
      <Literal>
        <ID>name</ID>
        <Default>Name</Default>
      </Literal>
      <Literal>
        <ID>valueType</ID>
        <Default>int</Default>
      </Literal>
      <Literal>
        <ID>valueField</ID>
        <Default>Id</Default>
      </Literal>
      <Literal>
        <ID>textField</ID>
        <Default></Default>
      </Literal>
      <Literal>
        <ID>controller</ID>
        <Default></Default>
      </Literal>
      <Literal>
        <ID>action</ID>
        <Default></Default>
      </Literal>
    </Declarations>
    <Code Language="HTML">
      <![CDATA[
@Html.DevExpress().ComboBox(s =>
{
    s.Name = "$name$";
    s.ShowModelErrors = true;
    s.Properties.DropDownRows = 30;
    s.Properties.ValueType = typeof($valueType$);
    s.Properties.ValueField = "$valueField$";
    s.Properties.TextField = "$textField$";
    s.Properties.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
    s.Properties.EnableCallbackMode = true;
    s.CallbackRouteValues = new { Controller = "$controller$", Action = "$action$" };
    s.ControlStyle.CssClass = "editor";
}).BindList().Bind(Model).GetHtml()
      ]]>
    </Code>
  </Snippet>
</CodeSnippet>